#include<stdio.h>
class Point
{
    public:
        Point(int xx, int yy);
        Point(const Point& p);
        Point();
        ~Point()
        {
            printf("~Point = %p\n", this);
        }
        int GetX() const {return X;}
        int GetY() const {return Y;}
    private:
        int X, Y;
};

Point::Point(int xx, int yy)
{
    X = xx;
    Y = yy;
    printf("xx = %d, yy = %d\n", xx, yy);
    printf("Point::Point(int, int) = %p\n", this);
}
Point::Point(const Point& p)
{
    X = p.X;
    Y = p.Y;
    printf("copy construct: p: X = %d, Y = %d\n", p.X, p.Y);
    printf("Point::Point(const Point &) =  %p -> %p\n", &p, this);
}

void Func_D(Point p)
{
    //printf("D.get X = %d\n", p.GetX());
}
Point Func_C()
{
    Point A(1, 2);
    //printf("a = %p\n", &A);
    Func_D(A);
    return A;
}

int main(int argc, char *argv[])
{
    Point A(1, 1);
    printf("A.get X = %d\n", A.GetX());
    //Point B(A);
    //printf("B.get X = %d\n", B.GetX());
    Point a(2, 3);
    printf("a.get X = %d\n", a.GetX());
    Point b = a;
    Func_D(a);

    //printf("C.get X = %d\n", c.GetX());
    //Func_D(A);
    return 0;
}
